// Created from GenerationTemplate
// For Decisions HL7 Engine
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Reflection;
using DecisionsFramework.Design.Properties;
using Decisions.HL7.Generated.AbstractMessage;
using Decisions.HL7.DataTypes;
using ST = System.String;
using SI = System.String;
using TX = System.String;
using FT = System.String;
using IS = System.String;
using ID = System.String;
using SNM = System.String;

namespace Decisions.HL7.Message
{
    [DataContract]
	public class CNN : AbstractDataType
    {

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("1 ID Number",1)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST IDNumber {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("2 Family Name",2)]
  	    [HL7Field(HL7Version.v24, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 2, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 2, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST FamilyName {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("3 Given Name",3)]
  	    [HL7Field(HL7Version.v24, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 3, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 3, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST GivenName {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("4 Second and Further Given Names or Initials Thereof",4)]
  	    [HL7Field(HL7Version.v24, 4, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 4, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 4, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 4, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 4, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SecondandFurtherGivenNamesorInitialsThereof {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("5 Suffix (e.g., JR or III)",5)]
  	    [HL7Field(HL7Version.v24, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 5, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 5, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST SuffixegJRorIII {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("6 Prefix (e.g., DR)",6)]
  	    [HL7Field(HL7Version.v24, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 6, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 6, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST PrefixegDR {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("7 Degree (e.g., MD)",7)]
  	    [HL7Field(HL7Version.v24, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 7, HL7Repeat.False, HL7Required.True,"IS")]
		[DegreeLicenseCertificate]
	    public IS DegreeegMD {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("8 Source Table",8)]
  	    [HL7Field(HL7Version.v24, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 8, HL7Repeat.False, HL7Required.True,"IS")]
		[CNIDSource]
	    public IS SourceTable {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("9 Assigning Authority   - Namespace ID",9)]
  	    [HL7Field(HL7Version.v24, 9, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 9, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 9, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 9, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 9, HL7Repeat.False, HL7Required.True,"IS")]
		[AssigningAuthority]
	    public IS AssigningAuthorityNamespaceID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("10 Assigning Authority  - Universal ID",10)]
  	    [HL7Field(HL7Version.v24, 10, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v25, 10, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v251, 10, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v26, 10, HL7Repeat.False, HL7Required.True,"ST")]
  	    [HL7Field(HL7Version.v27, 10, HL7Repeat.False, HL7Required.True,"ST")]
	    public ST AssigningAuthorityUniversalID {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("11 Assigning Authority  - Universal ID Type",11)]
  	    [HL7Field(HL7Version.v24, 11, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v25, 11, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v251, 11, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v26, 11, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v27, 11, HL7Repeat.False, HL7Required.True,"ID")]
		[UniversalIDType]
	    public ID AssigningAuthorityUniversalIDType {get;set;}





		public override string GetER7(HL7ParserOptions options) {
			List<string> dataTypeParts = new List<string>();
		    dataTypeParts.Add(IDNumber);
		    dataTypeParts.Add(FamilyName);
		    dataTypeParts.Add(GivenName);
		    dataTypeParts.Add(SecondandFurtherGivenNamesorInitialsThereof);
		    dataTypeParts.Add(SuffixegJRorIII);
		    dataTypeParts.Add(PrefixegDR);
		    dataTypeParts.Add(DegreeegMD);
		    dataTypeParts.Add(SourceTable);
		    dataTypeParts.Add(AssigningAuthorityNamespaceID);
		    dataTypeParts.Add(AssigningAuthorityUniversalID);
		    dataTypeParts.Add(AssigningAuthorityUniversalIDType);
			return CleanUpTrailingComponentSeps(string.Join("" + options.ComponentSep, dataTypeParts.ToArray()), options);
		}
    }
}

